local Route = require("think.core.facade.Route")

    -- RESTful路由
    {"GET", "/users", "user#index"},
    {"POST", "/users", "user#create"},
    {"GET", "/users/:id", "user#show"},

-- 基础路由
Route.get("/", "index#welcome")

-- 路由分组
Route.group({prefix = "/api"}, function()
    Route.get("users", "user#index")
    Route.post("users", "user#create")
    
    -- 资源路由
    Route.resource("posts", {
        prefix = "v1" -- 支持分组嵌套
    })
end)

-- 带参数路由
Route.get("user/:id", "user#profile")
    :where("id", "%d+") -- 参数约束

-- 中间件示例
Route.get("/admin", "admin#index")
    :middleware({"auth", "admin"})

